home *** CD-ROM | disk | FTP | other *** search
- /* Horizontal Scroll 640
- ** ---------------------
- ** This opens an extra wide screen of 256x640 pixels, and hardware scrolls
- ** left and right. This is *totally* inadequate for platformers, shoot'em-ups
- ** etc because the picture size takes up huge amounts of memory. However for
- ** games like Skidmarks, Lemmings, Monkey Island, etc, such large screens can
- ** be a necessity.
- */
-
- MODULE 'games','games/games','exec/memory'
-
- PROC main()
- DEF screen:PTR TO gamescreen, palette:PTR TO INT, direction=1:LONG,
- sparkie:PTR TO sprite, zbxy:LONG, timer:LONG, loadpic:PTR TO picture
-
- palette := [ $0000,$0400,$0501,$0501,$0601,$0701,$0701,$0801,
- $0901,$0A01,$0B02,$0432,$0CC0,$0F00,$0211,$0880,
- $01C2,$0050,$0B0B,$0606,$0F20,$0910,$0BBB,$0FFF,
- $00BF,$0068,$0568,$09BF,$0FF0,$0EE0,$0BA0,$0540
- ]:INT;
-
- screen := [ GSV1,0,
- 0,0,0, -> Screen_Mem1/2/3
- 0, -> Screen link.
- palette, -> Address of palette.
- 0, -> Address of rasterlist.
- 32, -> Amt of colours in palette.
- 320,256,640,256, -> Screen & Pic Height/Width
- 4, -> Amt of planes.
- 0,0, -> X/Y screen offsets
- 0,0, -> X/Y picture offsets.
- HSCROLL OR SPRITES OR
- NOSPRBDR, -> Special attributes.
- LORES, -> Screen mode.
- INTERLEAVED, -> Screen type
- 0 -> Reserved.
- ]:gamescreen;
-
- sparkie := [ SPV1,0, -> Version number
- 0, -> Bank Number 0
- 0, -> Ptr to graphic
- 150,150, -> Beginning X/Y positions
- 0, -> Current frame
- 16,21, -> Width, Height
- 16, -> Amt of colours
- 16, -> Colour start in palette
- 2, -> Amt of planes
- LORES OR XLONG, -> Resolution attributes
- 0, -> Position in relation to playfields
- 0,0 -> Private
- ]:sprite;
-
- loadpic := [ PCV1,0, -> Version header.
- 0, -> Destination.
- 640,256, -> Width, Height.
- 5, -> Amount of Planes.
- 16, -> Amount of colours.
- palette, -> Palette (remap).
- LORES, -> Screen mode.
- INTERLEAVED, -> Destination.
- 0 -> Parameters.
- ]:picture;
-
- IF gmsbase := OpenLibrary('games.library',0)
- SetUserPri()
- IF (Add_Screen(screen) = ERR_OK)
- loadpic.data := screen.memptr1;
- IF (LoadPic('GAMESLIB:data/IFF.Pic640x256',loadpic) = ERR_OK)
- sparkie.data := SmartLoad('GAMESLIB:data/sparkie.raw',0,0,MEMF_CHIP)
- IF (sparkie.data)
- Show_Screen(screen)
- Init_Sprite(screen,sparkie)
- Update_Sprite(screen,sparkie)
- zbxy := Read_Mouse(JPORT1)
-
- REPEAT
- zbxy := Read_Mouse(JPORT1)
- IF (timer++ AND $1)
- IF (sparkie.frame = 5) THEN sparkie.frame := 0 ELSE sparkie.frame := sparkie.frame+1
- ENDIF
- sparkie.xpos := sparkie.xpos+getZBXYx(zbxy)
- sparkie.ypos := sparkie.ypos+getZBXYy(zbxy)
- IF (screen.picxoffset = 320) THEN direction := -2
- IF (screen.picxoffset = 0) THEN direction := 2
- screen.picxoffset := screen.picxoffset+direction
- Move_Picture(screen)
- Wait_OSVBL()
- Update_Sprite(screen,sparkie)
- UNTIL !(zbxy AND MB_LMB)
-
- FreeMemBlock(sparkie.data);
- ENDIF
- ENDIF
- Delete_Screen(screen)
- ENDIF
- CloseLibrary(gmsbase)
- ENDIF
- ENDPROC
-
-